



<div class="x-body">
    <form class="layui-form form_single" action="{:url()}" method="post">


        <div class="layui-form-item">
            <label class="layui-form-label">
                分红百分比（%）:
            </label>
            <div class="layui-input-block">
                <input type="number" name="bonus" />
                    <span style="display: inline-block;line-height: 38px;vertical-align: middle"></span>

            </div>
        </div>

        <input type="hidden" name="id" value="{$param['id']|default='0'}"/>







        <div class="box-footer">

            <input type="hidden" name="id" value="{$info['id']|default='0'}"/>

            <button type="button"  class="layui-btn ladda-button" data-style="slide-up"  onclick="save()">
                确 定
            </button>
            <a class="layui-btn ladda-button" onclick="javascript:cancel();return false;"><i class="fa fa-history"></i> 取 消</a>


        </div>

    </form>
</div>

<script>

    function save(){
        var id=$("[name='id']").val();
        var bonus=$("[name='bonus']").val();
        $.post("{:url('king_investment_update')}",{id:id,bonus:bonus},function (d) {
            if(d.code==1){
                var index = parent.layer.getFrameIndex(window.name);
                parent.layer.close(index);//关闭当
                parent.location.reload();
            }else{
                layer.msg(d.msg);
            }
        })
    }

    function cancel() {

        var index = parent.layer.getFrameIndex(window.name);
        parent.layer.close(index);//关闭当
    }

</script>